import React from 'react';
import ReactDOM from 'react-dom';
import {Router,Route,Link,IndexRoute,hashHistory} from 'react-router';
import {createStore,applyMiddleware} from 'redux';
import {Provider,connect} from 'react-redux';
import Reducer from './reducer.js'
import style from './../css/style.css';
import FunnyApp from './../components/FunnyApp.js';
import Child_dt from './../components/child_dt.js';
import Child_jt from './../components/child_jt.js';
import Child_wt from './../components/child_wt.js';
import thunk from 'redux-thunk';


const store=createStore(Reducer,{list:[]},applyMiddleware(thunk));

function render(){
	ReactDOM.render(
		<Provider store={store}>
			<Router >
				<Route path="/" component={FunnyApp}>
					<IndexRoute component={Child_dt}></IndexRoute>
					<Route path='dt' component={Child_dt}/>
					<Route path='jt' component={Child_jt}/>
					<Route path='wt' component={Child_wt}/>
				</Route>				
			</Router>			
		</Provider>,
		document.querySelector('#box')
	)
}

store.subscribe(render);
render();